package com.hgz.ssmdemo.common.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * 容器自动初始化类
 * @author 小志
 * @date 2025/6/25 - 15:19
 */
public class WebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[0];
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        // 将主配置类交给容器初始化
        return new Class[]{RootConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        // 拦截所有请求
        return new String[]{"/"};
    }
}
